```vue
<script setup>
import { ref, onMounted } from 'vue'
import { getGoodGuessLikesList } from '@/api/home'
const GoodGuessLikeList = ref([])
const counts = ref(0)
const loadingtext = ref('加载中...')
const arr = ref([])
const page = ref(1) // 当前页数
// 获取猜你喜欢列表
const getGoodGuessList = async (page, pageSize) => {
  return (await getGoodGuessLikesList(page, pageSize)).data.result.items
}
// 随机生成一个页数
const randomPage = () => {
  const num = Math.floor(Math.random() * Math.floor(counts.value / 10))
  const page = arr.value[num]
  arr.value.splice(num, 1) // 删除已选的页数，避免重复选择
  return page
}

// 当组件挂载时， 获取猜你喜欢列表
onMounted(async () => {
  // 获取猜你喜欢列表的数量
  counts.value = (await getGoodGuessLikesList()).data.result.counts
  for (let i = 1; i <= Math.ceil(counts.value / 10); i++) {
    arr.value.push(i)
  }
  // 获取猜你喜欢列表
  GoodGuessLikeList.value = await getGoodGuessList(randomPage())
})

// 下拉触底获取数据
const getData = async () => {
  page.value = randomPage()
  // 如果当前页数大于总页数，则返回没有更多了
  if (arr.value.length === 0) {
    uni.showToast({ title: '没有更多了', icon: 'none' })
    return (loadingtext.value = '没有更多了')
  }
  GoodGuessLikeList.value = [
    ...GoodGuessLikeList.value,
    ...(await getGoodGuessList(page.value, 10)),
  ]
  loadingtext.value = '加载中...'
}

// 上拉刷新方法
const refresherData = async () => {
  GoodGuessLikeList.value = [] // 清空列表
  arr.value = []
  for (let i = 1; i <= Math.ceil(counts.value / 10); i++) {
    arr.value.push(i)
  }
  getData() // 获取数据
}
defineExpose({ getData, refresherData })
</script>

<template>
  <!-- 猜你喜欢 -->
  <view class="caption">
    <text class="text">猜你喜欢</text>
  </view>
  <view class="guess">
    <navigator
      class="guess-item"
      v-for="item in GoodGuessLikeList"
      :key="item"
      :url="`/pages/goods/goods?id=${item.id}`"
    >
      <image class="image" mode="aspectFill" :src="item.picture"></image>
      <view class="name"> {{ item.name }} </view>
      <view class="price">
        <text class="small">¥</text>
        <text>{{ item.price }}</text>
      </view>
    </navigator>
  </view>
  <view class="loading-text"> {{ loadingtext }} </view>
</template>

<style lang="scss" scoped>
:host {
  display: block;
}
/* 分类标题 */
.caption {
  display: flex;
  justify-content: center;
  line-height: 1;
  padding: 36rpx 0 40rpx;
  font-size: 32rpx;
  color: #262626;
  .text {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 28rpx 0 30rpx;

    &::before,
    &::after {
      content: '';
      width: 20rpx;
      height: 20rpx;
      background-image: url(@/static/images/bubble.png);
      background-size: contain;
      margin: 0 10rpx;
    }
  }
}

/* 猜你喜欢 */
.guess {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 0 20rpx;
  .guess-item {
    width: 345rpx;
    padding: 24rpx 20rpx 20rpx;
    margin-bottom: 20rpx;
    border-radius: 10rpx;
    overflow: hidden;
    background-color: #fff;
    box-sizing: border-box;
  }
  .image {
    width: 304rpx;
    height: 304rpx;
  }
  .name {
    height: 70rpx;
    margin: 10rpx 0;
    font-size: 26rpx;
    color: #262626;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .price {
    line-height: 1;
    padding-top: 4rpx;
    color: #cf4444;
    font-size: 26rpx;
  }
  .small {
    font-size: 80%;
  }
}
// 加载提示文字
.loading-text {
  text-align: center;
  font-size: 28rpx;
  color: #666;
  padding: 20rpx 0;
}
</style>
```
